{% import "TopxiaWebBundle:Common:data-dict-macro.html.twig" as dict_macro %}
{% extends 'TopxiaWebBundle:MyOrder:layout.html.twig' %}

{% block title %}{{'退款记录'|trans}} - {{ parent() }}{% endblock %}
{% set main_nav = 'refunds' %}

{% block main_body %}

  {% if refunds %}
    <table class="table table-striped table-hover" id="refunds-table">
    	<thead>
    		<th>{{'退款订单'|trans}}</th>
    		<th>{{'退款申请时间'|trans}}</th>
    		<th>{{'退款状态'|trans}}</th>
    	</thead>
    	<tbody>
    		{% for refund in refunds %}
    		  {% set order = orders[refund.orderId] %}
    		  <tr>
      		  <td>
              {% if order.targetType == 'course' %}
                <a href="{{ path('course_show', {id:order.targetId}) }}" target="_blank">{{ order.title }}</a>
              {% elseif order.targetType == 'vip' %}
        		    <a href="{{ path('vip', {id:order.targetId}) }}" target="_blank">{{ order.title }}</a>
              {% else %}
                {{ order.title }}
              {% endif %}
      		    <div class="text-sm text-muted">{{'订单号：%sn%'|trans({'%sn%':order.sn})}}</div>
      		  </td>
      		  <td>
      		  	{{ refund.createdTime|date('Y-n-d H:i') }}
      		  </td>
      		  <td>
              {{ dict_macro.refundStatus(refund.status) }}
      		  </td>
    		  </tr>
    		{% endfor %}
  		</tbody>
  	</table>
    {{ web_macro.paginator(paginator) }}
  {% else %}
    <div class="empty">{{'没有退款记录'|trans}}</div>
  {% endif %}

{% endblock %}